<?php


#--------------------------------------------------
# ALL INCLUDES + STANDARD-VALUES
#--------------------------------------------------
include_once ("include/config.inc");
include_once ("include/global_fix_extern.inc");
include_once ("include/template.inc");
include_once ("include/class.db.php5");
include_once ("include/class.tools.php5");
include_once ("include/class.time.php5");
include_once ("include/bday.php5");

$svo = new db("svoptik");
$tools = new tool();
$time = new TimeUtil();

#--------------------------------------------------
# CREATE TEMPLATE
#--------------------------------------------------
$t = new Template("templates", "keep");
$t->set_file(array (
	"page" => "svoptik.tpl",
	"navi" => "navi.tpl",
	"ticker" => "ticker.tpl",
	"shop" => "shop.tpl"
));

#--------------------------------------------------
# INTRO
#--------------------------------------------------
session_start();
if (!isset ($_SESSION["introSeen"])) {
	$forward = "<meta http-equiv=\"refresh\" content=\"0; URL=intro.html\"/>";
	$_SESSION["introSeen"] = true;
	$t->set_var(array (
		"FORWARD" => $forward
	));
} else {
	$t->set_var(array (
		"FORWARD" => ""
	));
}
#--------------------------------------------------

#--------------------------------------------------
# CREATE NAVIGATION LEFT
#--------------------------------------------------
$links = "";
$url[] = array (
	"URL" => "archive.php5",
	"URL-TEXT" => "Archiv",
	"ONCLICK" => "",
	"TARGET" => "_self"
);
for ($i = 0; $i < count($url); $i++) {
	$links .= "
						  	  <tr height=\"15\">
						  		<td valign=\"top\"><img src=\"standard/spacer.gif\" width=\"20\" height=\"15\" border=\"0\" alt=\"\"></td>
						  		<td valign=\"top\"><a href=\"" . $url[$i]['URL'] . "\" class=\"sitenav\" target=\"" . $url[$i]['TARGET'] . "\" onClick=\"" . $url[$i]['ONCLICK'] . "\">" . $url[$i]['URL-TEXT'] . "</a></td>
						  		<td valign=\"top\"><img src=\"standard/spacer.gif\" width=\"20\" height=\"15\" border=\"0\" alt=\"\"></td>
						  	  </tr>
						  	 ";
}

$t->set_var(array (
	"LINKS" => $links
));
$right_nav = $t->parse("", "navi", true);
#--------------------------------------------------

#--------------------------------------------------
# CREATE ALL-TIME SAME THINGS
#--------------------------------------------------
include_once ("include/sameThings.php5");

#--------------------------------------------------

#--------------------------------------------------
# CREATE CONTENT 
#--------------------------------------------------
$content .= $t->parse("", "shop", true);
#--------------------------------------------------

#--------------------------------------------------
# PARSE & OUTPUT
#--------------------------------------------------
$t->set_var(array (
	"sitenav" => " NEWS",
	"ticker" => $ticker,
	"content" => $content . "<br/>",
	"navi" => $right_nav,
	"SYNCHRONIZE" => " "
));

$t->parse("ALL", "page", true);
$t->p("ALL");
?>
